package com.changxianggu.cloud.crawler.core.utils;

import cn.hutool.core.util.RandomUtil;

/**
 * 随机返回一个userAgent
 *
 * @author liuyuantao
 */
public class UserAgentUtil {

    public static final String[] USER_AGENT = new String[]{
            "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko",
            "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36",
            "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0"

    };

    public static String random() {
        return USER_AGENT[RandomUtil.randomInt(0, 2)];
    }
}
